import request from '@/utils/request'
import store from '../../store'
const subSysPrefix = '/bussSys'

// 业务系统检索
export function systemOrgSelect(postselectinfo) {
  postselectinfo.userid = store.getters.userid
  return request({
    url: subSysPrefix + '/SystemOrg/select',
    method: 'post',
    data: postselectinfo
  })
}

// 批量插入
export function batchInsertItem(data) {
  return request({
    url: subSysPrefix + '/SystemOrg/batchBySystemId/?systemId=' + data.systemId,
    method: 'POST',
    data: data.insertArr
  })
}

// 批量插入
export function batchBySystemIdEx(data) {
  return request({
    url: subSysPrefix + '/SystemOrg/batchBySystemIdEx/?systemId=' + data.systemId,
    method: 'POST',
    data: { so: data.insertArr, su: data.unSelectedOrgIds }
  })
}

// 业务系统检索
export function getOrgTrees(postselectinfo) {
  postselectinfo.userid = store.getters.userid
  return request({
    url: subSysPrefix + '/SystemOrg/getOrgTrees',
    method: 'post',
    data: postselectinfo
  })
}
